package com.lxh.interpreter;

/**
 * 解释器模式
 * Create by lxh on 2020/2/16
 */
public class Main {
    public static void main(String[] args) {
        Expression bob = new TerminalExpression("bob");
        Expression join = new TerminalExpression("join");

        Expression isMale = new OrExpression(bob, join);
        System.out.println("John is male " + isMale.interpret("join"));
    }
}
